<template>
    <div class="layout">
        <Layout>
            <Header>
                <i-menu name="菜单" mode="horizontal" theme="dark" active-name="1">
                    <div class="layout-logo">
                      收款吧收款码即时收钱系统
                    </div>
                    <div class="layout-nav">
                        <MenuItem name="merchant" to="/manage/merchant">
                            <Icon type="ios-navigate"></Icon>
                            <span>商户信息管理</span>
                        </MenuItem>
                        <MenuItem name="payOrder" to="/manage/payOrder">
                            <Icon type="ios-keypad"></Icon>
                            <span>收款订单管理</span>
                        </MenuItem>
                        <!-- <MenuItem name="payOrder" to="/page/doc">
                            <Icon type="ios-keypad"></Icon>
                            <span>技术对接文档</span>
                        </MenuItem> -->
                        <Button @click="logout" type="primary">安全退出</Button>
                    </div>
                </i-menu>
            </Header>
            <Content >
                <Breadcrumb class="myBreadcrumb">
                    <BreadcrumbItem>首页</BreadcrumbItem>
                    <BreadcrumbItem>{{this.$route.meta.title}}</BreadcrumbItem>
                </Breadcrumb>
                <div class="routerViewBox">
                  <router-view />
                </div>
            </Content>
            <Footer class="layout-footer-center">2018-2018 &copy; 450153554@qq.com</Footer>
        </Layout>
    </div>
</template>
<script>
import {removeToken, setEnviromentForPC} from '@/utils/auth'

export default {
    data() {
        return{

        }
    },
    methods: {
        // 处理登出操作
        logout() {
            this.$Modal.confirm({
                title: "提示",
                content: "您确定要安全退出吗?",
                onOk: () => { 
                    // 删除本地token
                    removeToken();
                    // 跳转到登录页面
                    // 2、跳转到主页
                    this.$router.push({path: "/login"});
                }
            });
        }
    },
    // 组件挂载时执行
    mounted() {
        // 设置环境
        setEnviromentForPC();
    }
}
</script>

<style scoped>
.layout{
    border: 1px solid #d7dde4;
    background: #f5f7f9;
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
    width: 100%;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    width: 100%;
}
.ivu-layout {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  width: 100%;
}


.layout-logo{
    height: 30px;
    border-radius: 3px;
    float: left;
    color: #fff;
    font-size: 24px;
}
.layout-nav{
    /* width: 420px; */
    margin: 0 auto;
    margin-right: 20px;
    float: right;
}
.myBreadcrumb {
  padding: 10px;
}

.routerViewBox2{
  height: 100%;
  overflow: auto;
}

.layout-footer-center{
    text-align: center;
    color: #ccc;
    padding: 10px 0;
}
</style>